<template>
  <!--退卡工单-->
  <div class="tuika">
    <div class="search"><input type="text" placeholder="搜索" v-model="queryContent"><img src="../../assets/search.png" alt="" width="16"  @click="goSearch()"></div>
    <wv-tabs v-model="activeIndex" class="container" @click="changeActiveIndex()">
      <wv-tab title="全部">
        <!--1审核通过,2审核拒绝,3退卡专员审核中,4退卡专员审核拒绝,5退卡专员审核通过,6退款专员专员审核中,7退款专员审核拒绝,8退款专员审核通过,9退款专员已退款,10财务经理审核拒绝,11财务经理审核通过-->
        <ul class="list">
          <li v-for="item in addCheckRecordlist">
            <ul>
              <li>{{item.mobile}} <span>{{item.userName}}</span>
                <span class="status" v-if="item.isCheck==0">审核中</span>
                <span class="status" v-if="item.isCheck==1">审核通过</span>
                <span class="status" v-if="item.isCheck==2">审核拒绝</span>
              </li>
              <li><p><span v-if="item.optType==1">补录时间：{{item.subDate}}</span><span v-if="item.optType==2">减录时间：{{item.subDate}}</span><br><span v-if="item.isCheck==2"></span></p>
              </li>
            </ul>
          </li>
        </ul>
      </wv-tab>
      <wv-tab title="审核中">
        <ul class="list">
          <li v-for="item in addCheckRecordlist">
            <ul>
              <li>{{item.mobile}} <span>{{item.userName}}</span>
                <span class="status" v-if="item.isCheck==0">审核中</span>
                <span class="status" v-if="item.isCheck==1">审核通过</span>
                <span class="status" v-if="item.isCheck==2">审核拒绝</span>
              </li>
              <li><p><span v-if="item.optType==1">补录时间：{{item.subDate}}</span><span v-if="item.optType==2">减录时间：{{item.subDate}}</span><br><span v-if="item.isCheck==2">取消说明：由客户专员1314发起</span></p>
              </li>
            </ul>
          </li>
        </ul>
      </wv-tab>
      <wv-tab title="审核完成">
        <ul class="list">
          <li v-for="item in addCheckRecordlist">
            <ul>
              <li>{{item.mobile}} <span>{{item.userName}}</span>
                <span class="status" v-if="item.isCheck==0">审核中</span>
                <span class="status" v-if="item.isCheck==1">审核通过</span>
                <span class="status" v-if="item.isCheck==2">审核拒绝</span>
              </li>
              <li><p><span v-if="item.optType==1">补录时间：{{item.subDate}}</span><span v-if="item.optType==2">减录时间：{{item.subDate}}</span><br><span v-if="item.isCheck==2">取消说明：由客户专员1314发起</span></p>
              </li>
            </ul>
          </li>
        </ul>
      </wv-tab>
      <wv-tab title="审核拒绝">
        <ul class="list">
          <li v-for="item in addCheckRecordlist">
            <ul>
              <li>{{item.mobile}} <span>{{item.userName}}</span>
                <span class="status" v-if="item.isCheck==0">审核中</span>
                <span class="status" v-if="item.isCheck==1">审核通过</span>
                <span class="status" v-if="item.isCheck==2">审核拒绝</span>
              </li>
              <li><p><span v-if="item.optType==1">补录时间：{{item.subDate}}</span><span v-if="item.optType==2">减录时间：{{item.subDate}}</span><br><span v-if="item.isCheck==2">取消说明：{{item.remarkb}}</span></p>
              </li>
            </ul>
          </li>
        </ul>
      </wv-tab>
    </wv-tabs>
    <router-link to="/addchecktijiao" tag="p" class="offer"><img src="../../assets/xinjian.png" alt="" width="18">新建</router-link>
  </div>
</template>

<script type="text/ecmascript-6">
  import {getAddCheckData} from '../../../test/unit/http'
  import {Toast} from 'we-vue'
  export default {
    name: '',
    props: {},
    data() {
      return {
        activeIndex: 0,
        addCheckRecordlist: [],
        queryContent:''
      };
    },
    methods: {
      getData(params){
        getAddCheckData(params).then(res => {
          console.log(res);
          if (res.code == 100) {
            this.addCheckRecordlist = res.object.rows;
          } else {

          }
        })
      },
      goCancelTuika(backcardRecordId){
        cancelTuika({backcardRecordId: backcardRecordId}).then(res => {
          console.log(res);
          if (res.code==100) {
            this.getData({})
          }
        })
      },
      changeActiveIndex(){
        let params = {};
        let activeIndex = this.activeIndex;
        if (activeIndex == 1) {
          params['isCheck'] = 0;
        }
        if (activeIndex == 2) {
          params['isCheck'] = 1;
        }
        if (activeIndex == 3) {
          params['isCheck'] = 2;
        }
        this.getData(params)
      },
      goSearch(){
        let params = {};
        let activeIndex = this.activeIndex;
        if (activeIndex == 1) {
          params['isCheck'] = 0;
        }
        if (activeIndex == 2) {
          params['isCheck'] = 1;
        }
        if (activeIndex == 3) {
          params['isCheck'] = 2;
        }
        params['queryContent']=this.queryContent;
        this.getData(params)
      }
    },
    created() {
      this.getData({})
    },
    components: {}
  }
</script>


<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  .search {
    position: relative;
    width: 95%;
    margin: 10px auto;
    input {
      width: 90%;
      border: 1px solid #eee;
      box-shadow: 0 3px 4px rgba(17, 17, 17, 0.05);
      border-radius: 7px;
      height: 25px;
      line-height: 25px;
      padding: 10px;
      color: #111;
    }

    img {
      position: absolute;
      right: 20px;
      top: 16px;
    }
  }

  .list {
    padding-bottom: 70px;
    > li {
      margin: 15px 10px;
      text-align: left;
      border-bottom: 1px solid #ddd;
      li {
        margin-bottom: 10px;
      }
      li:first-child {
        font-size: 16px;
        color: #111;
        font-weight: 700;
        span {
          color: #999;
          margin-left: 10px;
        }
        .status {
          font-size: 13px;
          float: right;
          font-weight: normal;
        }
      }
      li:last-child {
        font-size: 12px;
        color: #666;
        display: flex;
        text-align: left;
        .lookdetail {
          background-color: #fff;
          border: 1px solid #f98e3c;
          color: #f98e3c;
        }
        p {
          flex: 1;
        }
      }
    }
    > li:last-child {
      border-bottom: none;
    }

  }

  .offer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #f98e3c;
    height: 50px;
    line-height: 50px;
    color: #fff;
    img {
      vertical-align: middle;
      margin-right: 5px;
    }
  }
</style>
